import Vue from "vue";
import VueRouter from "vue-router";

import mlgl from "../views/mlgl.vue";

import dxgl from "../views/dxgl.vue";

import shouye from "../views/shouye.vue";










Vue.use(VueRouter);

const routes = [
  // {
  //   path: "/",
  //   redirect: "/zonglan",
  // },
  {
    path: "/mlgl",
    name: "mlgl",
    component: mlgl,
  },

  {
    path: "/dxgl",
    name: "dxgl",
    component: dxgl,
  },


  {
    path: "/shouye",
    name: "shouye",
    component: shouye,
  },





  // 数据资产
  {
    path:'/dataAssets',
    name: 'AataAssets',
    component: () => import('../views/dataAssets.vue')
  },
  {
    path:'/dataAssetsDetail',
    name: 'DataAssetsDetail',
    component: () => import('../views/dataAssetsDetail.vue')
  },
  {
    path:'/shoppingCart',
    name: 'ShoppingCart',
    component: () => import('../views/shoppingCart.vue')
  },
  {
    path:'/myCollect',
    name: 'MyCollect',
    component: () => import('../views/myCollect.vue')
  },
  {
    path:'/dataApply',
    name: 'AataApply',
    component: () => import('../views/dataApply.vue')
  }
  

];

const router = new VueRouter({
  routes,
  scrollBehavior(to, from, savePosition) {
    if (savePosition) {
      //解决页面从列表页跳转到详情页返回,初始在原来位置
      return savePosition
    } else {
      //解决页面跳转后页面高度和前一个页面高度一样
      return { x: 0, y: 0 }
    }
  }

});
export default router;
